Why Building?

In most cases you will not need to build WebWork yourself, since the distribution package contains all you need to get started and productive with WebWork. See Getting Started for more information on how to start working with the distributed binaries. However, there are situations where you want to build WebWork from scratch, for example if you want to try out tweaks and patches, or simply if want to check the head of current development. For the latter, a solution apart from building WebWork from scratch might be to have a look into our Ivy Repository containing continous integration builds ("nightly builds"), containing the latest build of WebWork and XWork jars.

Getting the Sources

Distribution

The current distribution packages of WebWork contain all sources, as well as all needed libraries for building jars and running. Distribution packages are found here.
The dependency resolution via Ivy is disabled by default for the build from a distribution package (> Webwork 2.2 Beta 4). If you need to work with the Clover and Ivy-related buildfile tasks, you might want to follow the instructions below.

SVN

The full source code can be found at the OpenSymphony Subversion repository:
https://svn.opensymphony.com/svn under the webwork directory.

If you want to access the latest version, be sure to check out the webwork/trunk directory. There are some other branches available under webwork/branches (such as WW 2.1.x).

We suggest using a plugin to checkout the sources and commit changes. There are several plugins available for both Eclipse (subclipe) and IntelliJ (built in, nowadays).

If anyone bothers to check out the command line commands for SVN, please put them here.

Building

We assume that you are familiar with ant as the standard build tool in the Java world.

command description
ant init let ivy update webwork's dependencies
ant clean clean up webwork build
ant test run webwork tests cases
ant compile compile webwork source code
ant test-compile compile webwork testcases source code
ant jar create a jar file for webwork
ant dist create a webwork distribution (with jar file, javadoc etc.)

What is Ivy?

If you checked out the sources from CVS, you might have noticed that the lib directory is empty. Unfortunately this does not mean that webwork has no external dependecies at all. To be honest, as a full featured MVC framework it has lots of dependencies, which in turn means that there has to be some dependency management. This is where Ivy comes to play.
Ivy is a free java based dependency manager, with powerful features such as transitive dependencies, maven repository compatibility, continuous integration, html reports and many more. Ivy is fully integrated with ant, so you do not have to get into a complicated tool. See http://jayasoft.org/ivy for details.

Installing and using Ivy

The installation is quite trivial: Put a copy of the ivy-1.x.jar found in the common directory of the opensymphony module in your $ANT_HOME/lib directory.
If you want to test the Ivy functionality, ensure you have an internet connection. Change into the webwork module directory and execute ant init(as you might guess, any other task depends on init). Ivy will now resolv all dependencies and (hopefully) download all required jars and put it into the lib directory.
See Dependencies for informations on how to integrate Ivy in your own Webwork2 based projects.
Skipping dependency resolution (> Webwork 2.2 Beta 4)

The build now knows the property "skip.ivy". This may be specified from build.properties file or from a command line ant execution with -Dskip.ivy=true. If set, dependency resolution via Ivy is omitted and build is done with current jars found in lib directory.
This behaviour is turned on by default for builds from the distribution package.


 

 

JUnit and Clover

The full build process will require JUnit and Clover.
Place a copy of junit.jar (>= 3.8.1) and clover.jar and its license jar file (>= 1.3.9) into your $ANT_HOME/lib directory (if not already exists). If you don't have these jars at hand, look in the lib/build directory of your WebWork module after you called ant init in the step before...
OpenSymphony Clover license is found in the common directory of the opensymphony module. Place the clover-license.jar into your $ANT_HOME/lib directory as well. Now you are ready to ...

Build

Call ant jar or simply ant to build the WebWork jars. Play around with other targets, as you like.

JDK/JRE Compatibility

WebWork requires JDK 1.4.2+ to build. JDK 5.0 is not required for building.
WebWork-based applications require JRE 1.4.2+ to run. JRE 5.0 is not required to run unless your application uses the optional xwork-tiger module, which adds some Java 5.0 specific features to XWork/WebWork functionality.